package com.cps.framecommon.response;


import lombok.*;

import java.util.List;

/**
 * @param <T>
 */
@Setter
@Getter
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class PageDTO<T> {

    /**
     * 列表数据
     */
    private List<T> list;

    /**
     * 总记录数
     */
    private Integer totalCount;
    /**
     * 每页记录数
     */
    private Integer pageSize;
    /**
     * 总页数
     */
    private Integer totalPage;
    /**
     * 当前页数
     */
    private Integer currPage;

    public PageDTO(List<T> list, PageInfo pageInfo) {
        this.list = list;
        this.totalCount = pageInfo.getTotalCount();
        this.pageSize = pageInfo.getPageSize();
        this.totalPage = pageInfo.getTotalPage();
        this.currPage = pageInfo.getCurrPage();
    }
}
